<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%><%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:insertDefinition name="layout">
	<tiles:putAttribute name="head">
		<style type="text/css">
.selected {
	visibility: hidden;
}
</style>
		<script type="text/javascript">
			$(function() {
				$(".date").datepicker({
					showWeek : true,
					firstDay : 1,
					dateFormat : 'yy-mm-dd',
					showOtherMonths : true,
					selectOtherMonths : true
				});
				$("#datepicker").datepicker({
					showWeek : true,
					firstDay : 1,
					dateFormat : 'yy-mm-dd',
					showOtherMonths : true,
					selectOtherMonths : true,
					onSelect : function(date, source) {
						$("form").submit();
					}
				});
			});
		</script>
	</tiles:putAttribute>
	<tiles:putAttribute name="mainBody">
		<ul class="breadcrumb">
			<li><a href="listSubject.do">课程列表</a> <span class="divider">/</span></li>			
			<li class="active">修改课程</li>
		</ul>
		<form class="form-horizontal">
			<fieldset>
				<legend>修改课程信息</legend>
				<div class="control-group">
					<label class="control-label">课程名称</label>
					<div class="controls">
						<input name="name" type="text" placeholder="名称" value="${subject.name}">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">课程描述</label>
					<div class="controls">
						<input name="title" type="text" value="${subject.title}">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">课程形式</label>
					<div class="controls">
						<select>
							<s:iterator value="forms" var="form">
								<option id="${form}" <s:if test="#form == #subject.form">selected="selected"</s:if>>
									<s:property value="#form" />
								</option>
							</s:iterator>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">课程内容</label>
					<div class="controls">
						<div class="form-inline">
							<s:iterator value="contents" var="content">
								<label class="checkbox">
									<input type="checkbox" value="content" name="content" <s:if test="#content.id in #subject.contents.{id}">checked="checked"</s:if> />
									<s:property value="#content.name" />
								</label>
							</s:iterator>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">计费方式</label>
					<div class="controls">
						<select>
							<s:iterator value="billingModels" var="billingModel">
								<option id="${billingModel}" <s:if test="#billingModel == #subject.billingModel">selected="selected"</s:if>>
									<s:property value="#billingModel" />
								</option>
							</s:iterator>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">课程时间</label>
					<div class="controls">
						<div>
							<div class="input-append">
								<input name="months" type="text" value="${subject.months}"><span class="add-on">月</span>
							</div>
						</div>
						<div>
							<div class="input-append">
								<input name="days" type="text" value="${subject.days}"><span class="add-on">天</span>
							</div>
						</div>
						<div>
							<div class="input-append">
								<input name="hours" type="text" value="${subject.hours}"><span class="add-on">课时</span>
							</div>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">合同说明</label>
					<div class="controls">
						<textarea rows="10" cols="50"></textarea>
					</div>
				</div>
			</fieldset>
		</form>
	</tiles:putAttribute>
</tiles:insertDefinition>